package model;

/**
 * This Class is a SubscriptionRequest Model which Saves Subscription Request Details for Customer .
 * @author Tal
 *
 */

public class SubscriptionRequest 
{		
		private int uid;
		private int gid;
		private long creditN;
		private int ccv;
		private String expire;	
		
		

		/**
		 * This is Default SubscriptionRequest constructor.
		 * @param uid is a 0.
		 * @param gid is a 0.
		 * @param creditN is a 0.
		 * @param ccv is 0 .
		 * @param expire is " ".
		 */
		public SubscriptionRequest()
		{
	       
			this.uid=0;
			this.gid=0;
			this.creditN=0;
			this.ccv=0;
			this.expire="";	
		
		}
			
		/**
		 * This is SubscriptionRequest constructor.
		 * @param uid is a Customer ID.
		 * @param comid is a Customer Group ID.
		 * @param creditN is a Customer credit number .
		 * @param expire is a subscription expiration.
		 */
		
		public SubscriptionRequest(int uid, int gid, long creditN, int ccv, String expire)
		{
			this();
			this.uid=uid;
			this.gid=gid;
			this.creditN=creditN;
			this.ccv=ccv;
			this.expire=expire;
		
		}
		
		
		/**
		 * This method returns customer id .
		 * @return int uid.
		 */
			public int getUID() {
				return this.uid;
			}

		/**
		 * This method sets new customer id to customer .
		 * @param uid - new cus's Id.
		 */
			public void setUID(int cusID) {
				this.uid = cusID;
			}


		/**
		 * This method returns Group ID.
		 * @return int gid.
		 */
			public int getGID() {
				return this.gid;
			}

		/**
		 * This method sets new group id .
		 * @param groupid - new group Id.
		 */
			public void setGID(int groupID) {
				this.gid = groupID;
			}

				
		/**
		 * This method returns Credit Number.
		 * @return long creditN.
		 */
			public long getCreditN() {
				return this.creditN;
			}

		/**
		 * This method sets new Credit Number.
		 * @param creditNum - new credit number.
		 */
			public void setCreditN(long creditNum) {
				this.creditN = creditNum;
			}
					
		/**
		  * This method returns CCV.
		  * @return int ccv.
		 */
			public int getCCV() {
				return  this.ccv; 
			}
			
		
		/**
		  * This method sets new ccv.
		  * @param CCV - new ccv .
		  */
	    	public void setCCV(int CCV) {
			this.ccv = CCV;
		    }
	    	

			/**
			  * This method returns subscribe expiration .
			  * @return String expire.
			 */
			
			public String getExpire() {
				return this.expire; 
			}
			
			/**
	    	 * This method get String status 
	    	 * @param Expire - new expire
	    	 */
	    	
	    	public void setExpire(String Expire)
	    	{
	    		this.expire=Expire;
	    	}
	    	
	    	/**
			  * This method returns ServiceId by Name .
			  * @return String ServiceName.
			 */
			
			public String getServiceByName(int gid) {
				String ServiceName=null;
				  switch (gid) {
		            case 2:  ServiceName = "Package Customer";
		                     break;
		            case 5:  ServiceName = "Daily Photo";
		                     break;
		            case 6:  ServiceName = "Business Layer";
		                     break;
		            case 7:  ServiceName = "Infrastructure Layer";
		                     break;         
		            default: ServiceName = "Invalid Service";
		                     break;
		        }
				  
				  return ServiceName;
				  
			}
	    	
	    	/**
	    	 * This method toString-all vars of class
	    	 * @param String
	    	 */
	    	
	    	public String toString(){
	    		return "Uid:  "+ getUID() + "\nServiceID:  " + getGID() +"\nService:  "+getServiceByName(getGID())   + "\nCredit Number:  " + getCreditN() + "\nCCV: " + getCCV() + "\nExpiration:  " + getExpire();
	    	}


}
